package cn.edu.sicau.databasepp.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "device_table", schema = "sqlexcise", catalog = "")
public class DeviceTableEntity
{
    private long deviceId;
    private String status;

    @Id
    @Column(name = "device_id", nullable = false)
    public long getDeviceId()
    {
        return deviceId;
    }

    public void setDeviceId(long deviceId)
    {
        this.deviceId = deviceId;
    }

    @Basic
    @Column(name = "status", nullable = true, length = 6)
    public String getStatus()
    {
        return status;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    @Override
    public boolean equals(Object o)
    {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DeviceTableEntity that = (DeviceTableEntity) o;
        return deviceId == that.deviceId &&
                Objects.equals(status, that.status);
    }

    @Override
    public int hashCode()
    {
        return Objects.hash(deviceId, status);
    }
}
